package com.hexb.smh.entity.view;

import com.hexb.core.utils.ObjectUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @author : hexb
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommissionDiscountRate {

    @ApiModelProperty("不包含")
    private BigDecimal min;
    private BigDecimal max;

    private String key;

    public CommissionDiscountRate(String min, String max) {
        this.min = ObjectUtils.safeCall(() -> new BigDecimal(min), null);
        this.max = ObjectUtils.safeCall(() -> new BigDecimal(max), null);
    }

    public String getMinString() {
        return min == null ? null : min.toString();
    }

    public String getMaxString() {
        return max == null ? null : max.toString();
    }
}
